package com.gper.edu.vip.builder.common;

import lombok.Data;

/**
 * @Author: ellis.guan
 * @Description: 计算机类
 * @Date: 2020/2/29 21:25
 * @Version: 1.0
 */
public class Computer {

    private final String cpu;
    private final String mainBoard;
    private final String hardDisk;
    private final String memory;
    private final String  videoCard;
    private final String monitor;

    private Computer(String cpu, String mainBoard, String hardDisk, String memory, String videoCard,String monitor) {
        this.cpu = cpu;
        this.mainBoard = mainBoard;
        this.hardDisk = hardDisk;
        this.memory = memory;
        this.videoCard = videoCard;
        this.monitor = monitor;
    }

    @Override
    public String toString() {
        return "Computer{" +
                "cpu='" + cpu + '\'' +
                ", mainBoard='" + mainBoard + '\'' +
                ", hardDisk='" + hardDisk + '\'' +
                ", memory='" + memory + '\'' +
                ", videoCard='" + videoCard + '\'' +
                ", monitor='" + monitor + '\'' +
                '}';
    }

    public static class Builder{
        private String cpu;
        private String mainBoard;
        private String hardDisk;
        private String memory;
        private String videoCard;
        private String monitor;

        public Builder setCpu(String cpu) {
            this.cpu = cpu;
            return this;
        }

        public Builder setMainBoard(String mainBoard) {
            this.mainBoard = mainBoard;
            return this;
        }

        public Builder setHardDisk(String hardDisk) {
            this.hardDisk = hardDisk;
            return this;
        }

        public Builder setMemory(String memory) {
            this.memory = memory;
            return this;
        }

        public Builder setVideoCard(String videoCard) {
            this.videoCard = videoCard;
            return this;
        }

        public Builder setMonitor(String monitor) {
            this.monitor = monitor;
            return this;
        }

        public Computer builderComputer(){
            return new Computer(cpu,mainBoard,hardDisk,memory,videoCard,monitor);
        }
    }
}
